package restful.servlet;

import java.io.*;

import javax.servlet.*;
import javax.servlet.http.*;

public class NotFoundResponder extends ResponderSupport {

	public NotFoundResponder(final String contextPath) {}

	@Override
	public String dispatch(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/plain");
		response.setStatus(HttpServletResponse.SC_NOT_FOUND);
		final PrintWriter writer = response.getWriter();
		writer.println("not found");
		writer.flush();
		writer.close();
		return "notfound";
	}
}
